import { Injectable } from '@angular/core';
import { Observable} from 'rxjs';
import { Http} from '@angular/http';
import { GlobalService} from "../../../../global.service";

@Injectable()
export class ProblemNewService {

  constructor(
    private http:Http,
    private globalService:GlobalService,
  ) { }

  saveProblem(data): Observable<any>{
    console.log("send data:",data);
    return this.http.post(this.globalService.api+'/services/core/saveProblem',data);
  }

  findProblemByCode(code):Observable<any>{
    return this.http.get(this.globalService.api+'/services/core/findProblem/'+code);
  }

  findTestData(code):Observable<any>{
    return this.http.get(this.globalService.api+'/services/core/findTestData/'+code);
  }

}
